//
//  NSString+Value.h
//  SLAppProduct
//
//  Created by Jianbo Cai on 2018/4/4.
//  Copyright © 2018年 Sunline. All rights reserved.
//

#import <Foundation/Foundation.h>

#define IsNullToString(a) [NSString isNullToString:a]

@interface NSString (Value)

+ (NSString *)isNullToString:(id)string;

/// 转化为百分比数值(eg:0.123 -> 12.3%)
- (NSString *)convertToPercentage;

/// 保留几位小数(eg:0.123 -> 0.12)
- (NSString *)retainTheDecimalAFew:(NSUInteger)uint;

/// 单位换算保留几位小数(eg:123456789 -> 1.2亿)
- (NSString *)chineseUnitConversionDecimal:(NSUInteger)uint;

/// 服务器返回的时间戳转化
- (NSString *)serverTimestampConversionWithFormat:(NSString *)format;

/// 为空设置默认值
- (NSString *)setDefaultValuesForNull;

@end
